/**
 * 
 */
package com.zhaoyan.cms.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhaoyan.cms.mapper.LinkMapper;
import com.zhaoyan.cms.pojo.Link;
import com.zhaoyan.cms.service.LinkService;

/**
 * @author zhaoyan
 *
 * 2020年2月1日
 */
@Service
public class LinkServiceImpl implements LinkService{

	@Autowired
	private LinkMapper linkMapper;

	@Override
	public PageInfo<Link> findLinkList(Integer pageNum) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum, 5);
		
		
		return new PageInfo<Link>(linkMapper.findLinks());
	}

	@Override
	public Integer addLink(Link link) {
		// TODO Auto-generated method stub
		return linkMapper.addLink(link);
	}

	@Override
	public Integer delLink(Integer id) {
		// TODO Auto-generated method stub
		return linkMapper.delLink(id);
	}

	@Override
	public Link findLinkById(Integer id) {
		// TODO Auto-generated method stub
		return linkMapper.findLinkById(id);
	}

	@Override
	public Integer updateLink(Link link) {
		// TODO Auto-generated method stub
		return linkMapper.updateLink(link);
	}

	@Override
	public List<Link> findLinkList() {
		// TODO Auto-generated method stub
		return linkMapper.findLinkList();
	}
	
	
	
	
	
	
}
